package leetcode_2501_2600;

import java.util.ArrayList;
import java.util.List;

public class LeeCode_2544 {
    public static void main(String[] args) {

    }
    private static int alternateDigitSum(int n) {
        List<Integer> list = new ArrayList<>();
        while (n != 0){
            list.add(n % 10);
            n /= 10;
        }
        int t = 1, ans = 0;
        for(int i = list.size() - 1; i >= 0;i--){
            ans += list.get(i) * t;
            t *= -1;
        }
        return ans;
    }
}
